import Vue from "vue";
import VueRouter from "vue-router";
import Index from "@/components/index/Index.vue";
import Kefu from "@/components/kefu/Kefu.vue";
import login from "@/components/login.vue";
import ProductManage from "@/components/ecssProduct/ProductManage.vue";
import Register from "@/components/register.vue";
import Quanbukehu from "@/components/Kehuguanli/Quanbukehu.vue";
import OrderQueryComponent from "../components/kefu/OrderQueryComponent.vue";
import LogisticsQueryComponent from "@/components/kefu/LogisticsQueryComponent.vue";
import AfterSaleQueryComponent from "@/components/kefu/AfterSaleQueryComponent.vue";
import UserQueryComponent from "@/components/kefu/UserQueryComponent.vue";
import ZYProductManage from "@/components/ZYProduct/ZYProductManage.vue";
import ZYProductList from "@/components/ZYProduct/ZYProductList.vue";
import AnswerQuery from "@/components/kefu/AnswerQuery.vue";
import OrderManage from "@/components/ecssProduct/OrderManage.vue";
import DispatchList from "@/components/ecssProduct/DispatchList.vue";
import OrderDetail from "@/components/ecssProduct/OrderDetail.vue";
import Shouhou from "@/components/shouhou/Shouhou.vue";
import ackQuestion from "@/components/kefu/ackQuestion.vue";
import Kehudengji from "@/components/Kehuguanli/Kehudengji.vue";
import ZYproductListDetail from "@/components/ZYProduct/ZYProductListDetail.vue";
import CouponManagement from "@/components/marketing/CouponManagement.vue";
import AddCoupon from "@/components/marketing/AddCoupon.vue";
//客服
import Online from "@/components/kefu/Online.vue";
import RoleAuthorityManagemet from "@/components/authorityManagement/RoleAuthorityManagemet.vue";
import RoleManagement from "@/components/authorityManagement/RoleManagement.vue";
import ZYElectronicInvoice from "@/components/ZYProduct/ZYElectronicInvoice.vue";
import FaceRegister from "@/components/FaceRegister.vue";
import FaceLogin from "@/components/FaceLogin.vue";
import UserManagement from "@/components/authorityManagement/UserManagement.vue";
import HuiHua from "@/components/kefu/HuiHua.vue";
import yeji from "../components/kefu/yeji.vue"
import shouye from "../components/index/shouye.vue"
import EcssProductType from "../components/ecssProduct/EcssProductType"

Vue.use(VueRouter); //注册
const routes = [
  //登录注册
  {
    path: "/login",
    name: "login",
    component: login,
  },
  //注册
  {
    path: "/register",
    component: Register,
  },
  { path: "/dispatchList", component: DispatchList },
  {
    path: "/ZYElectronicInvoice",
    component: ZYElectronicInvoice
  },
  {
    path: "/FaceLogin",
    component: FaceLogin
  },
  {
    path: "/",
    component: Index,
    redirect: '/shouye',
    children: [
      { path:"/EcssProductType", component:EcssProductType},
      { path: "/shouye", component: shouye },
      { path: "/productManage", component: ProductManage },
      { path: "/addCoupon", component: AddCoupon },
      { path: "/orderManage", component: ()=>import("@/components/ecssProduct/OrderManage.vue") },
      { path: "/couponManagement", component: CouponManagement },
      { path: "/orderDetail", component: OrderDetail },
      { path: "/roleManagement", component: RoleManagement },
      { path: "/roleAuthorityManagemet", component: RoleAuthorityManagemet },
      { path: "/userManagement", component: UserManagement },
      { path: "/shouhou", component: Shouhou },
      //中移管理
      {
        path: "/ZYProductManage",
        component: ZYProductManage,
      },
      {
        path: "/ZYProductList",
        component: ZYProductList,
      },
      {
        path: "/ZYproductListDetail",
        component: ZYproductListDetail,
      },
      {
        path: "/quanbukehu",
        component: Quanbukehu,
      },
      {
        path: "/kehudengji",
        component: Kehudengji,
      },
      {
        path: "/FaceRegister",
        component: FaceRegister
      },
    ],

  },
  //客服模块
  {
    path: "/kefu",
    component: Kefu,
    children: [
      {
        path: '/yeji',
        component: yeji

      },
      {
        path: "/OnLine",
        component: Online,
      },
      {
        path: "/ackQuestion",
        component: ackQuestion,
      },
      {
        path: "/orderQuery",
        component: OrderQueryComponent,
      },

      {
        path: "/logisticsQuery",
        component: LogisticsQueryComponent,
      },
      {
        path: "/afterSaleQuery",
        component: AfterSaleQueryComponent,
      },
      {
        path: "/userQuery",
        component: UserQueryComponent,
      },
      {
        path: "/answerQuery",
        component: AnswerQuery,
      },
      {
        path: "/HuiHua",
        component: HuiHua,
      }
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
